﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using CUREBusinessLogicLayer;

/*************************************************************************************

     * 作   者： 张 颖
  
*************************************************************************************/
namespace CURE.SystemManagement
{
    public partial class SystemModuleEdit : System.Web.UI.Page
    {
        #region 参数
        private string url;

        public string Url
        {
            get { return Request.QueryString["action"]; }
            set { url = value; }
        }
        #endregion
        ModulBll moduBll = new ModulBll();
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request.QueryString["type"];
            string action = Request.QueryString["action"];
            switch (type)
            {
                case "father":
                    BindDataFather(action);
                    break;
                case "child":
                    BindDataChild(action);
                    break;
                default:
                    break;
            }
        }
        /// <summary>
        /// 绑定父节点
        /// </summary>
        /// <param name="name"></param>
        public void BindDataFather(string name)
        {
            DataTable dt = new DataTable();
            dt = moduBll.GetChildModuleByfatherId(name);
            if (dt != null && dt.Rows.Count > 0)
            {
                RepeaterMoudle.DataSource = dt;
                RepeaterMoudle.DataBind();

            }
        }
        /// <summary>
        /// 绑定子节点
        /// </summary>
        /// <param name="name"></param>
        public void BindDataChild(string name)
        {
            DataTable dt = moduBll.GetChildModuleById(name);
            if (dt != null && dt.Rows.Count > 0)
            {
                RepeaterMoudle.DataSource = dt;
                RepeaterMoudle.DataBind();

            }
        }
    }
}
